<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <title>李奥曼到达倒计时</title>
  <style>
    body {
      font-family: "Helvetica Neue", Arial, sans-serif;
      background: #f0f2f5;
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
      margin: 0;
    }
    .container {
      background: #fff;
      padding: 40px 30px;
      border-radius: 12px;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
      text-align: center;
      width: 360px;
      animation: fadeIn 1s ease;
    }
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(-20px); }
      to { opacity: 1; transform: translateY(0); }
    }
    h1 {
      font-size: 24px;
      color: #333;
      margin-bottom: 20px;
    }
    #result {
      margin-top: 20px;
      font-size: 22px;
      color: #28a745;
      font-weight: bold;
      min-height: 28px;
      transition: all 0.5s;
    }
  </style>
</head>
<body>

<div class="container">
  <h1>距离李奥曼到达车站还有多久？</h1>
  <div id="result">计算中...</div>
</div>

<script>
const targetTime = new Date(2025, 3, 27, 18, 0, 0); // 注意：月份是从0开始，4月是3！

function updateCountdown() {
  const now = new Date();
  const diffMs = targetTime - now;

  const resultDiv = document.getElementById('result');

  if (diffMs <= 0) {
    resultDiv.textContent = "李奥曼已经到达！";
    clearInterval(timer);
    return;
  }

  const diffSec = Math.floor(diffMs / 1000);
  const days = Math.floor(diffSec / (3600 * 24));
  const hours = Math.floor((diffSec % (3600 * 24)) / 3600);
  const minutes = Math.floor((diffSec % 3600) / 60);
  const seconds = diffSec % 60;

  resultDiv.textContent = 
    `还有 ${days}天 ${hours}小时 ${minutes}分钟 ${seconds}秒`;
}

// 每秒更新一次
updateCountdown(); // 先执行一次，避免等待
const timer = setInterval(updateCountdown, 1000);
</script>

</body>
</html>
